package com.dhcc.zhyl.springMVC.entity;

// default package
// Generated 2017-10-30 16:18:32 by Hibernate Tools 4.3.5.Final
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * AcctUser generated by hbm2java
 */
@Entity
@Table(name = "acct_user")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler", "acctRoles" })
public class AcctUser implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2003788189151067148L;
	private String id;
	private String nickName;
	private String telephone;
	private Date registerTime;
	private String cardId;
	private Set<AcctRole> acctRoles = new HashSet<AcctRole>(0);

	public AcctUser() {
	}

	public AcctUser(String id, String nickName) {
		this.id = id;
		this.nickName = nickName;
	}

	public AcctUser(String id, String nickName, String telephone, Date registerTime, String cardId, Set<AcctRole> acctRoles) {
		this.id = id;
		this.nickName = nickName;
		this.telephone = telephone;
		this.registerTime = registerTime;
		this.cardId = cardId;
		this.acctRoles = acctRoles;
	}

	@Id

	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "nick_name", nullable = false)
	public String getNickName() {
		return this.nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	@Column(name = "telephone")
	public String getTelephone() {
		return this.telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "register_time", length = 19)
	public Date getRegisterTime() {
		return this.registerTime;
	}

	public void setRegisterTime(Date registerTime) {
		this.registerTime = registerTime;
	}

	@Column(name = "card_id", unique = true)
	public String getCardId() {
		return this.cardId;
	}

	public void setCardId(String cardId) {
		this.cardId = cardId;
	}

	@ManyToMany(fetch = FetchType.EAGER)
	@JoinTable(name = "acct_user_role", joinColumns = { @JoinColumn(name = "user_id", nullable = false, updatable = false) }, inverseJoinColumns = {
			@JoinColumn(name = "role_id", nullable = false, updatable = false) })
	public Set<AcctRole> getAcctRoles() {
		return this.acctRoles;
	}

	public void setAcctRoles(Set<AcctRole> acctRoles) {
		this.acctRoles = acctRoles;
	}

}
